﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Drawing;
using ErgoBreak.Core.Resources;
using ErgoBreak.Presentation.Components;
using ErgoBreak.Presentation;

namespace ErgoBreak
{
    class ProgramBuilder
    {
        private ResourceCollection resources;
        private string path;

        public ProgramBuilder(string programPath)
        {
            path = programPath;
        }

        public Program Build()
        {
            ResourceBuilder rcBuilder = new ResourceBuilder(path);
            this.resources = rcBuilder.Build();
            // build the presentation layer
            PresentationBuilder pBuilder = new PresentationBuilder(this.resources);
            Tray tray = pBuilder.Build();
            // build the program
            return new Program(this.resources, tray);
        }
    }
}
